現場のPython (mypy) PEPリンク
型ヒントまわりのPEPをまとめて紹介している印象
PEP560で型ヒントとtypingモジュールの扱いが言語コアによるサポートとなったPython3.7以降 (WEB+DB PRESS Vol.125 (Japanese Edition) (p.431). Kindle 版. )
当初 PEP 484 は、 CPython のインタプリタのコア部分に どんな 変更も施さないような方法で設計されていました。 今では型ヒントと typing モジュールはコミュニティに広く使われるようになったため、この制限は取り除かれました。(強調は引用者による)
Initially PEP 484 was designed in such way that it would not introduce any changes to the core CPython interpreter. Now type hints and the typing module are extensively used by the community, (略) (PEP560 Abstract)
__class_getitem__
__mro_entries__
Python 3.6がたしか2021年12月でサポートが切れるので、言語コアで型ヒントをサポートするPythonだけになる
Python3.7や3.8を使用する場合、from__future__importannotationsを先頭に記述すると同様に記述できます。(WEB+DB PRESS Vol.125 (Japanese Edition) (p.436). Kindle 版. )
組み込みのジェネリック型(Python 3.9)の話題
Python 3.9. For use cases restricted to type annotations, Python files with the "annotations" future-import (available since Python 3.7) can parameterize standard collections, including builtins.
(__class_getitem__を使って実装している?)Impementation